package work;

import java.io.*;

public class Search {

    public static void main(String[] args) throws IOException {

        String key = "任建";

        String line;

        BufferedReader reader = new BufferedReader(new FileReader(new File("C:\\Users\\dinglei\\Desktop\\第五批_中间文件\\原始文件-格式化后.txt")));

        while ((line = reader.readLine()) != null) {

            if (line.contains(key)) {
                System.out.println("搜索结果:" + line.split("->")[0]);
            }
        }


    }

}
